# Maintainer: Nick Chiu <coding.nikazu@gmail.com>
pkgname=php7-pecl-simple-kafka-client
_extname=simple_kafka_client
pkgver=0.1.4
pkgrel=0
pkgdesc="PHP 7 extension for Kafka based on librdkafka - PECL"
url="https://pecl.php.net/package/simple_kafka_client"
arch="all"
license="BSD-3-Clause"
depends="php7-common"
makedepends="php7-dev file librdkafka-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"

provides="php7-simple-kafka-client=$pkgver-r$pkgrel" # for backward compatibility
replaces="php7-simple-kafka-client" # for backward compatibility

build() {
	phpize7
	./configure --prefix=/usr --with-php-config=/usr/bin/php-config7
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php7/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
450055cfe1b5a4b966a4cfdffffc89a3d1ac737a9d0b24aa66126f925cdbb5d7b5287a8c7e9bea5fe859cd360ba4683564837f8abd93567b54e6284687c3f4fb  php-pecl-simple_kafka_client-0.1.4.tgz
"
